<h3 class="page-title">
   	 车辆管理
</h3>

<div class="table-custom" >
    <div class="portlet">
		<div class="portlet-title">
			<button class="btn btn-success title-action" ng-click="mediaBusGrid.syncMediaBus();"
                   tabindex="0">
               <i class="fa fa-refresh"></i> 刷新车辆
           </button>
               <a href="javascript:void(0);" class="title-operation search-expand">筛选</a>
			<div class="title-search-box">
				<input type="text" placeholder="请输入小自编号" class="search-field" ng-model="mediaBusGrid.query.vehicleNoAbbr"
					style="width: 180px;" maxlength="100">
				<a class="fa fa-search" ng-click="mediaBusGrid.query();"></a>
			</div>
		</div>
		<div class="portlet-search-body" style="display: none">
				<form class="form-horizontal" role="form" style="margin: 2px;">
					 <div class="form-body">
                       	<div class="row" style="margin-bottom: 5px;">
                       		<div class="col-md-2">
                                   <div class="input-icon">
                                    	<i class="fa fa-bus"></i>
									<input class="form-control" placeholder="车牌号" ng-model="mediaBusGrid.query.plateNo">
                                   </div>
                               </div>
                               <div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
									<input class="form-control" placeholder="自编号" ng-model="mediaBusGrid.query.vehicleNo">
                                   </div>
                               </div>
                               <div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
									<input class="form-control" placeholder="线路" ng-model="mediaBusGrid.query.lineNo">
                                   </div>
                               </div>
                               <div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
                                      	<select class="form-control" style="color: #b3b3b3;" ng-model="mediaBusGrid.query.companyId" ng-options="opt.companyId as opt.companyName for opt in companys">
                                      		<option value="" >--营运公司 --</option>
									</select>
                                   </div>
                               </div>
                              	<div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
                                      	<select class="form-control" style="color: #b3b3b3;" ng-model="mediaBusGrid.query.busType" ng-options="opt.typeCode as opt.typeName for opt in busTypes">
                                      		<option value="" >--车型 --</option>
									</select>
                                   </div>
                               </div>
                       	</div>
                       	<div class="row">
                               <div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
                                      	<select class="form-control" style="color: #b3b3b3;" ng-model="mediaBusGrid.query.busFloor" ng-options="opt.value as opt.name for opt in options.BUS_FLOOR">
                                      		<option value="" >--双巴-- </option>
									</select>
                                   </div>
                               </div>
                              	<div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
									<select class="form-control" style="color: #b3b3b3;" ng-model="mediaBusGrid.query.airConditioned" ng-options="opt.value as opt.name for opt in options.BUS_AIRCONDITIONED">
                                      		<option value="" >--空调-- </option>
									</select>
                                   </div>
                               </div>
                               <div class="col-md-2">
                                   <div class="input-icon">
                                    	<i class="fa fa-bus"></i>
                                    	<select class="form-control" style="color: #b3b3b3;" ng-model="mediaBusGrid.query.busEnergy" ng-options="opt.value as opt.name for opt in options.BUS_ENERGY">
                                      		<option value="" >--能源-- </option>
									</select>
                                   </div>
                               </div>
                               <div class="col-md-2">
                                   <div class="input-icon">
                                      	<i class="fa fa-bus"></i>
                                      	<select class="form-control" style="color: #b3b3b3;" ng-model="mediaBusGrid.query.businessType" ng-options="opt.value as opt.name for opt in options.BUS_BUSINESSTYPE">
                                      		<option value="" >--营运方式 --</option>
									</select>
                                   </div>
                               </div>
                               
                               <div class="col-md-2">
                                   <div class="input-icon">
                                       <button class="btn btn-primary" ng-click="mediaBusGrid.query();">
										<i class="fa fa-search"></i> 搜索
									</button>
									<button class="btn btn-primary" ng-click="mediaBusGrid.reset();">
										<i class="fa fa-rotate-left"></i> 重置
									</button>
                                   </div>
                               </div>
                       	</div>
                               
      					</div>
                              
                       
                	</form>
		</div>
		<div class="portlet-body">
			<table ed-grid="mediaBusGrid" class="table table-striped table-bordered table-hover dataTable"
                  ed-url="media/bus/query.do" ed-model="bus" style="width: 100%">
                <thead>
	                <tr>
	                    <th ed-width="3%" ed-data="_index"></th>
	                    <th ed-width="8%" ed-data="plateNo">车牌号</th>
	                    <th ed-width="8%" ed-data="vehicleNo">自编号</th>
	                    <th ed-width="7%" ed-data="vehicleNoAbbr">小自编号</th>
	                    <th ed-width="7%" ed-data="lineNo">线路</th>
	                    <th ed-width="7%" ed-data="companyName">营运公司</th>
	                    <th ed-width="10%" ed-data="onlineDate">上线年限</th>
	                    <th ed-width="5%" ed-data="busType">车型</th>
	                    <th ed-width="5%" ed-data="busFloor">双巴</th>
	                    <th ed-width="5%" ed-data="airConditioned">空调</th>
	                    <th ed-width="5%" ed-data="busEnergy">能源</th>
	                    <th ed-width="5%" ed-data="businessType">营运方式</th>
	                    <th ed-width="20%">操作</th>
	                </tr>
                </thead>
           	</table>
		</div>
	</div>

	
	<div ed-modal="busEditModal" data-options="title:'车辆编辑',icon:'fa-bus',static:true,width:'900px'">
        <div class="form" style="overflow: auto;height: 500px;">
                    <form action="#" class="form-horizontal form-row-seperated w5c-form" w5c-form-validate novalidate name="busMediaForm">
                        <div class="form-body">
                        	<div class="row">
                        		<div class="col-md-12">
                        			<div class="form-group">
                                		<label class="col-md-2 control-label">车&nbsp; 牌&nbsp;号：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.plateNo}}</p>
		                                </div>
		                                <label class="col-md-2 control-label">自&nbsp; 编&nbsp;号：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.vehicleNo}}</p>
		                                </div>
                            		</div>
                        		</div>
                        	</div>
                        	<div class="row">
                        		<div class="col-md-12">
	                        		<div class="form-group">
	                                	<label class="col-md-2 control-label">线　　路：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.lineNo}}</p>
		                                </div>
		                                <label class="col-md-2 control-label">营运公司：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.companyName}}</p>
		                                </div>
	                            	</div>
                        		</div>
                        	</div>
                        	<div class="row">
                        		<div class="col-md-12">
	                        		<div class="form-group">
	                                	<label class="col-md-2 control-label">车　　型： </label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.busType}}</p>
		                                </div>
		                                <label class="col-md-2 control-label">单&nbsp; 双&nbsp;层：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.busFloor}}</p>
		                                </div>
	                            	</div>
                        		</div>
                        	</div>
                        	<div class="row">
                        		<div class="col-md-12">
	                        		<div class="form-group">
	                                	<label class="col-md-2 control-label">上线年限： </label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.onlineDate}}</p>
		                                </div>
		                                <label class="col-md-2 control-label">营运方式：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.businessType}}</p>
		                                </div>
	                            	</div>
                        		</div>
                        	</div>
                        	<div class="row">
                        		<div class="col-md-12">
	                        		<div class="form-group">
	                                	<label class="col-md-2 control-label">空　　调： </label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.airConditioned}}</p>
		                                </div>
		                                <label class="col-md-2 control-label">能　　源：</label>
		                                <div class="col-md-4">
		                                	<p class='form-control-static'>{{mediaBus.busEnergy}}</p>
		                                </div>
	                            	</div>
                        		</div>
                        	</div>
                        	<div class="row">
                        		<div class="col-md-12">
	                        		<div class="form-group">
	                                	<label class="col-md-2 control-label">照　　片：</label>
		                                <div class="col-md-10">
			                                <div ed-uploader data-options="text:' 文件上传',multiple: true,maxLength:4,accept:'image/*'" class="ng-uploader" ng-model="mediaBus.busImgs" ed-upload-dir="bus"></div>
			                                <div class="mix-grid" style="display: block;" >
						                    	<div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;" ng-repeat="img in mediaBus.busImgs">
						                    		<div class="mix-inner">
														<img class="img-responsive" ng-src="{{nginxPath+img.path}}" alt="" style="width:150px;height:120px">
														<div class="mix-details" style="height:50%;">
															<a class="mix-link" ng-click="busEditModal.removeBusImg(img);">
																<i class="fa fa-close" ></i>
															</a>
															<a class="mix-preview fancybox-button" ng-href="{{nginxPath+img.path}}" data-rel="fancybox-button">
																<i class="fa fa-search"></i>
															</a>
														</div>
													</div>
												</div>
											</div>
		                                </div>
	                            	</div>
                        		</div>
                        	</div>
                        </div>
                    </form>
            </div>
	</div>
	
	<div ed-modal="busLineModal" data-options="title:'车辆定位',icon:'fa-bus',static:true,width:'1100px',defaultButton:false">
        <div id="busLineModalMapDiv" style="overflow: auto;height: 600px;width: 100%;">
                    
        </div>
	</div>
	
	<div ed-modal="busMediaInfoModal" data-options="title:'车辆信息',icon:'fa-bus',static:true,width:'900px',defaultButton:false">
		<div class="form" style="overflow: auto;height: 500px;">
			<form action="#" class="form-horizontal form-row-seperated w5c-form" w5c-form-validate novalidate name="busMediaForm">
				<div class="form-body">
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label class="col-md-2 control-label">车&nbsp; 牌&nbsp;号：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.plateNo}}</p>
								</div>
								<label class="col-md-2 control-label">自&nbsp; 编&nbsp;号：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.vehicleNo}}</p>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label class="col-md-2 control-label">车辆线路：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.lineNo}}</p>
								</div>
								<label class="col-md-2 control-label">营运公司：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.companyName}}</p>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label class="col-md-2 control-label">车　　型： </label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.busType}}</p>
								</div>
								<label class="col-md-2 control-label">单&nbsp; 双&nbsp;层 ：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.busFloor}}</p>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label class="col-md-2 control-label">上线年限： </label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.onlineDate}}</p>
								</div>
								<label class="col-md-2 control-label">营运方式 ：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.businessType}}</p>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label class="col-md-2 control-label">空　　调： </label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.airConditioned}}</p>
								</div>
								<label class="col-md-2 control-label">能　　源 ：</label>
								<div class="col-md-4">
									<p class='form-control-static'>{{mediaBus.busEnergy}}</p>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label class="col-md-2 control-label">照　　片：</label>
								<div class="col-md-10">
	                               	<div class="mix-grid" style="display: inline;" ng-repeat="img in mediaBus.busImgs">
				                    	<div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;">
				                    		<div class="mix-inner">
												<img class="img-responsive" ng-src="{{nginxPath+img.path}}" alt="" style="width:150px;height:120px">
												<div class="mix-details" style="height:50%;">
													<a class="mix-preview fancybox-button" style="position: static;display: inline-block;" ng-href="{{nginxPath+img.path}}" data-rel="fancybox-button">
														<i class="fa fa-search"></i>
													</a>
												</div>
											</div>
										</div>
									</div> 
	                        	</div>
							</div>
						</div>
	
					</div>
				</div>
			</form>
		</div>
	</div>
	
	<div ed-modal="busResourcesModal" data-options="title:'车辆媒体资源',icon:'fa-bus',static:true,width:'900px',defaultButton:false">
	    <div style="padding: 5px;width: 100%;overflow: auto;height:500px;">
			<div class="portlet">
				<div class="portlet-body">
					<div ng-repeat="media in mediaTypes">
						<div>
							<span style="font-weight: bold;">{{media.mediaName}}：</span>
							<button class="btn btn-success" ng-click="busResourcesModal.toAdd(media);" style="padding: 0px 5px;float: right; margin-right: 15px;">
								<i class="fa fa-plus"></i> 新增
							</button>
						</div>
	                	
	                	<table class="table table-striped table-bordered table-hover dataTable" style="width: 100%;font-size: 9px;">
		                    <thead>
			                    <tr style="">
			                        <th style="text-align: center;width: 3%;"></th>
			                        <th style="text-align: center;font-weight: bold;">资源编号</th>
			                        <th style="text-align: center;font-weight: bold;">规格</th>
			                        <th style="text-align: center;font-weight: bold;">状态</th>
			                        <th style="text-align: center;font-weight: bold;" ng-repeat="item in media.items">{{item.itemName}}</th>
			                        <th style="text-align: center;font-weight: bold;width: 120px;">操作</th>
			                    </tr>
		                    </thead>
	                    	<tbody>
						         	<tr style="text-align: center;color: {{resource.status == '1' ? '':'lightgray'}}" role="row" ng-repeat="resource in mediaBus.resources  | filter : {mediaType:media.mediaId}">
			                            <td>{{$index + 1}}</td>
				                        <td>
				                        	<a ng-show="resource.resourceImg && resource.resourceImg != ''" class="mix-preview"  ng-href="{{nginxPath+resource.resourceImg}}" data-rel="fancybox-button">{{resource.resourceCode}}</a>
				                        	<span ng-show="!resource.resourceImg || resource.resourceImg == ''">{{resource.resourceCode}}</span>
				                        </td>
				                        <td>{{resource.model}}</td>
				                        <td>{{resource.status | code:'DATA_STATUS'}}</td>
				                        <td ng-repeat="item in media.items">
				                        	<span ng-if="item.itemType == 'CODE'">{{resource[item.itemId] | code:item.enumCode}}</span>
				                        	<span ng-if="item.itemType != 'CODE'">{{resource[item.itemId]}}</span>
				                        </td>
				                        <td>
				                        	<button class="btn btn-xs btn btn-edit" ng-if="resource.status == '1'" ng-click="busResourcesModal.toEdit(resource, media);"><i class="fa fa-edit"></i> 编辑</button>
				                        	<button class="btn btn-xs btn btn-delete" ng-if="resource.status == '1'" ng-click="busResourcesModal.remove(resource);"><i class="fa fa-trash-o"></i> 废除</button>
				                        	<button class="btn btn-xs btn btn-success" ng-if="resource.status != '1'" ng-click="busResourcesModal.revert(resource);"><i class="fa fa-undo"></i> 启用</button>
				                        </td>
			                        </tr>
							</tbody> 
	                	</table>
	                	<hr/>
	                </div>
				</div>
			</div>
	    </div>
	</div>
	
	<div ed-modal="busResourceEditModal" data-options="title:'车辆媒体资源编辑',icon:'fa-bus',static:true,width:'450px'">
	    <div style="height: 400px;margin: 5px;overflow: auto;">
				<form action="#" class="form-horizontal form-row-seperated w5c-form" w5c-form-validate novalidate name="resourceForm">
			        		<div class="form-body">
	                        	<div class="row">
	                        		<div class="col-md-12">
		                        		<div class="form-group">
		                                	<label class="col-md-2 control-label"><span class="required">*</span>编号</label>
			                                <div class="col-md-8">
			                                    <input type="text" class="form-control" name="resourceCode" ng-model="busResourceEditModal.resource.resourceCode" required>
			                                </div>
		                            	</div>
	                        		</div>
	                        	</div>
	                        	<div class="row">
	                        		<div class="col-md-12">
		                        		<div class="form-group">
		                                	<label class="col-md-2 control-label"><span class="required">*</span>规格</label>
			                                <div class="col-md-8">
			                                    <input type="text" class="form-control" name="model" ng-model="busResourceEditModal.resource.model" required>
			                                </div>
		                            	</div>
	                        		</div>
	                        	</div>
	                        	<div class="row" ng-repeat="item in busResourceEditModal.media.items">
	                        		<div class="col-md-12">
		                        		<div class="form-group">
		                                	<label class="col-md-2 control-label">{{item.itemName}}</label>
			                                <div class="col-md-8">
			                                	<input ng-if="item.itemType != 'CODE'" type="text" class="form-control" ng-model="busResourceEditModal.resource[item.itemId]">
			                                	<select ng-if="item.itemType == 'CODE'" class="form-control" name="resourceLevel" ng-model="busResourceEditModal.resource[item.itemId]"  ng-options="opt.value as opt.name for opt in options[item.enumCode]">
		                                		</select>
			                                </div>
		                            	</div>
	                        		</div>
	                        	</div>
	                        	<div class="row">
	                        		<div class="col-md-12">
		                        		<div class="form-group">
		                                	<label class="col-md-2 control-label">照片</label>
			                                <div class="col-md-9">
						                        <div ed-uploader data-options="text:' 文件上传',accept:'image/*'" class="ng-uploader" ng-model="busResourceEditModal.resource.file" ed-upload-dir="bus_resource">
						                        </div>
						                        <div class="mix-grid" style="display: block;">
							                    	<div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;">
							                    		<div class="mix-inner">
															<img class="img-responsive" ng-src="{{busResourceEditModal.resource.file.path ? (nginxPath + busResourceEditModal.resource.file.path):' '}}" alt="请上传照片" style="width:150px;height:120px">
															<div class="mix-details" style="height:50%;" ng-if="busResourceEditModal.resource.file.path">
																<a class="mix-preview fancybox-button"  style="position: static;display: inline-block;" ng-href="{{nginxPath+busResourceEditModal.resource.file.path}}" data-rel="fancybox-button">
																	<i class="fa fa-search"></i>
																</a>
															</div>
														</div>
													</div>
												</div>
						                    </div>
		                            	</div>
	                        		</div>
	                        	</div>
	                        </div>
	            </form>	
	    </div>
	</div>

	<div ed-modal="busTransModal" data-options="title:'车辆异动明细',icon:'fa-bus',static:true,width:'900px',defaultButton:false">
		<div style="padding: 5px;width: 100%;overflow: auto;height:500px;">
			<div class="portlet">
				<div class="portlet-body">
					<table class="table table-striped table-bordered table-hover dataTable" style="width: 100%;font-size: 9px;">
						<thead>
							<tr style="">
								<th style="text-align: center;font-weight: bold;">异动时间</th>
								<th style="text-align: center;font-weight: bold;">异动详情</th>
							</tr>
						</thead>
						<tbody>
							<tr ng-show="busTransList != undefined && busTransList.length > 0" role="row" ng-repeat="transData in busTransList">
								<td style="text-align: center">{{transData.vehTransferTime | limitTo : '10'}}</td>
								<td style="text-align: center">
									<span ng-show="transData.type == '1'">
										从<span style="color: red">{{transData.companyOut}}</span> 调至 <span style="color: red">{{transData.companyIn}}</span>,
										线路从<span style="color: red">{{transData.lineOut}}</span> 调至 <span style="color: red">{{transData.lineIn}}</span>
									</span>

									<span ng-show="transData.type == '2'">
										从<span style="color: red">{{transData.companyOut}}</span> 调至 <span style="color: red">{{transData.companyIn}}</span>
									</span>

									<span ng-show="transData.type == '3'">
										从<span style="color: red">{{transData.companyOut}}</span> 调至 <span style="color: red">{{transData.companyIn}}</span>,
										车辆性质从<span style="color: red">{{transData.beforeBusKind}}</span> 变更为 <span style="color: red">{{transData.afterBusKind}}</span>,
										车辆分类从<span style="color: red">{{transData.beforeBusSort}}</span> 变更为 <span style="color: red">{{transData.afterBusSort}}</span>
									</span>
								</td>
							</tr>
							<tr ng-show="busTransList == undefined || busTransList.length == 0" role="row" >
								<td style="text-align: center" colspan="2">暂无调动记录</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
    

   
</div>